import { useAxios } from '@/hooks/web/useAxios'

const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 角色列表
export const ucRoleListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucRoleList',
      data: data
    }
  })
}

// 角色新增
export const ucRoleAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleAddAdmin',
      data: data
    }
  })
}

// 角色修改
export const ucRoleEditAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucRoleEditAdmin',
      data: data
    }
  })
}

// 角色查看
export const ucRoleSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucRoleSee',
      data: data
    }
  })
}

// 角色删除
export const ucRoleDelAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucRoleDelAdmin',
      data: data
    }
  })
}

// 角色批量删除
export const ucRoleBatchDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucRoleBatchDel',
      data: data
    }
  })
}

// 组织角色列表
export const ucOrgRoleListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucOrgRoleList',
      data: data
    }
  })
}
